<template>
	<div class="app">
		<Header v-show="$root.bNav" />
		<router-view />
		<Loading v-show="$root.bLoading"/>
		<app-footer v-show="$root.bFoot" />
	</div>
</template>
<script>
	import Header from './header.vue'
	import AppFooter from './footer.vue'
	import Loading from '../components/loading.vue'
	export default {
		components: {
			Header,
			AppFooter,
			Loading
		},
		watch: {
			$route: {
				handler(nextValue) {
					let path = nextValue.path;
					if (/home|home_report|news|message/.test(path)) {
						this.$root.bNav = this.$root.bFoot = true;
					}
					if (/login|reg/.test(path)) {
						this.$root.bNav = true;
						this.$root.bFoot = false;
					}
					if (/user|detail/.test(path)) {
						this.$root.bNav = false;
						this.$root.bFoot = true;
					}
				},
				immediate: true
			}
		}
	};
</script>
<style scoped>

</style>
